Skip to content

fix: export mktime and strftime from bare use POSIX#684

Merged
fglock merged 1 commit intomasterfrom
fix/posix-default-export-mktime
May 8, 2026
Merged

fix: export mktime and strftime from bare use POSIX#684
fglock merged 1 commit intomasterfrom
fix/posix-default-export-mktime

Conversation

@fglock
Copy link
Copy Markdown
Owner

@fglock fglock commented May 8, 2026

Summary

Stock Perl’s POSIX module puts mktime in the default export list, so code that does use POSIX and calls bare mktime works. PerlOnJava’s POSIX used a trimmed @EXPORT and omitted mktime, which broke Astro::SunTime (Undefined subroutine &Astro::SunTime::mktime).

strftime is also a common default export on core Perl and is implemented here, so it is included for the same compatibility reason.

Testing

  • make
  • ./jcpan -t Astro::SunTime (all tests pass)

Stock Perl puts `mktime` in POSIX's default `@EXPORT`, so CPAN code that
does `use POSIX` and calls `mktime` works. PerlOnJava's trimmed default
export list omitted it, breaking Astro::SunTime (and any similar caller).

Also export `strftime`, which is another default time export on core Perl
and is implemented here.

Fixes `./jcpan -t Astro::SunTime`.

Generated with [Cursor](https://cursor.com)

Co-Authored-By: Cursor <cursoragent@cursor.com>
@fglock fglock merged commit b47055b into master May 8, 2026
2 checks passed
@fglock fglock deleted the fix/posix-default-export-mktime branch May 8, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant